@isTest
public class ExWarehouseDetailBatchTest
{
    static testMethod void ExWarehouseDetailBatchTest()
    {
        Account a = new Account();
        a.Name='测试';
        insert a;
        RecordType  r = [SELECT ID,Name FROM RecordType WHERE SobjectType = 'ExWarehouse_Detail__c' and Name = '出库单明细'];

        ExWarehouse__c  e = new ExWarehouse__c();
        e.cgeneralhid__c = 'nc0001';
        e.Account__c = a.Id;
        
        insert e;
        ExWarehouse_Detail__c e1 = new ExWarehouse_Detail__c();
        e1.ExWarehouse__c = e.Id;
        e1.RecordTypeId = r.Id;
        insert e1;
     	Test.startTest();
      ExWarehouseDetailBatch batch = new ExWarehouseDetailBatch();
        database.executeBatch(batch,300);       
        Test.stopTest();  
    }
}